package cn.wit.front.controller;

import cn.wit.front.service.JobCategoryService;
import cn.wit.utils.pojo.JobCategory;
import cn.wit.utils.response.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/job/jobCategory")
@CrossOrigin
@Api(tags = "工作岗位")
public class JobCategoryController {
    private Logger logger = LoggerFactory.getLogger(JobCategoryController.class);

    @Autowired
    private JobCategoryService jobCategoryService;


    @GetMapping("/selectAllJobCategory")
    @ApiOperation("查询所有工作岗位")
    public Result selectAllJobCategory() {
        return this.jobCategoryService.selectAllJobCategory();
    }



    @GetMapping("/selectJobCategoryAll/{num}/{size}")
    @ApiOperation("分页查询所有工作岗位")
    public Result selectJobCategoryAll(@PathVariable("num") int num,
                                       @PathVariable("size") int size,HttpServletRequest request) {
        IPage<JobCategory> page = new Page<>(num, size);
        return this.jobCategoryService.selectAllPage(page);
    }
}
